Home:ALL Converter>Android: How to handle theming for older SDK's

Android: How to handle theming for older SDK's

Ask Time:2012-06-22T04:43:29         Author:TheLettuceMaster

Json Formatter

I have an app that is minSDK 10, target's 14. I'd love to use the Light.Holo Theme (if available for device--and falls back to light theme for older device). Is there a way I can do this this?

It seems it defaults to Dark.Holo when you target 14, but when I try to add any other theme, it overwrites it and makes it look older on newer devices.

Author:TheLettuceMaster,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/11146424/android-how-to-handle-theming-for-older-sdks
K_Anas :

You need to provide separate styles for both platforms to ensure that the correct style will be found at runtime.\n\nIn your res/values/styles.xml file, create the following style:\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <style name=\"Theme.MyTheme\" parent=\"@android:style/Theme.Light\" />\n</resources>\n\n\nIn your res/values-v11/styles.xml file, create the following style:\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <style name=\"Theme.MyTheme\" parent=\"@android:style/Theme.Holo.Light\" />\n</resources>\n\n\nIn your AndroidManifest.xml file, use the following line for your application's theme:\n\nandroid:theme=\"@style/Theme.MyTheme\"\n",
2012-06-21T20:57:54
yy